//
//  YMMoreMenuView.swift
//  NewVersionDemo
//
//  Created by zeng on 2018/3/20.
//  Copyright © 2018年 youmy. All rights reserved.
//

import UIKit

class YMMoreMenuView: UIView {

    var brandBtnBlock:((_ btn: UIButton)->())?
    
    var modelBtnBlock:((_ btn: UIButton)->())?
    
    var colourBtnBlock:((_ btn: UIButton)->())?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.frame = CGRect(x: 0, y: 0, width: ym_screen_width, height: 40)
    }
    
    @IBAction func brandBtnClickAction(_ sender: UIButton) {
        sender.isSelected = !sender.isSelected
        print("品牌")
        
        if (brandBtnBlock != nil) {
            brandBtnBlock?(sender)
        }
    }
    
    @IBAction func modelBtnClickAction(_ sender: UIButton) {
        sender.isSelected = !sender.isSelected
        print("型号")
        
        if (modelBtnBlock != nil) {
            modelBtnBlock?(sender)
        }
    }
    
    @IBAction func colourBtnClickAction(_ sender: UIButton) {
        sender.isSelected = !sender.isSelected
        print("成色")
        
        if (colourBtnBlock != nil) {
            colourBtnBlock?(sender)
        }
    }

}

extension YMMoreMenuView {
    class func nibView()->YMMoreMenuView{
        return Bundle.main.loadNibNamed("YMMoreMenuView", owner: nil, options: nil)?.first as! YMMoreMenuView
    }
}
